﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;

namespace BaHuan.BusinessLayer
{
    public class MucChiMgt
    {
        public ResultObj SaveNewMucChi(MucChi mucchi)
        {
            ResultObj result = new ResultObj();
            mucchi.Id = -1;
            MucChiDAO mucchiDAO = new MucChiDAO();
            result = mucchiDAO.SaveMucChi(mucchi);

            return result;
        }

        public ResultObj UpdateMucChi(MucChi mucchi)
        {
            ResultObj result = new ResultObj();
            MucChiDAO mucchiDAO = new MucChiDAO();
            result = mucchiDAO.SaveMucChi(mucchi);

            return result;
        }

        public ResultObj DeleteMucChi(MucChi mucchi)
        {
            ResultObj result = new ResultObj();
            MucChiDAO mucchiDAO = new MucChiDAO();
            result = mucchiDAO.DeleteMucChi(mucchi);

            return result;
        }

        public ResultObj GetAllMucChi()
        {
            ResultObj result = new ResultObj();
            MucChiDAO mucchiDAO = new MucChiDAO();
            result = mucchiDAO.GetAllMucChi();

            return result;
        }


        public ResultObj GetMucChiById(MucChi mucchi)
        {
            ResultObj result = new ResultObj();
            MucChiDAO mucchiDAO = new MucChiDAO();
            result = mucchiDAO.GetAllMucChiByID(mucchi);

            return result;
        }

    }
}
